library ProximitySpawnControl initializer init requires LegacySystem

	globals
		private trigger T
	endglobals
	
	private function ProximitySpawn takes nothing returns nothing
		call GankMarine(Player(13),'nzom',2+udg_Spawn,1300,1800)
		call GankMarine(Player(14),'nzom',2+GetRandomInt(1,udg_Spawn),1500,1800)
		call GankMarine(Player(14),'ugar',GetRandomInt(0,udg_Spawn),1500,2300)
		if udg_IntenseSpawn==1 then
			call GankMarine(Player(14),'n003',GetRandomInt(1,udg_Spawn),1500,1800)
			call GankMarine(Player(13),'n00M',GetRandomInt(0,2+udg_Spawn),1500,1800)
		endif
	endfunction

	function SetProximitySpawnEnabled takes boolean b returns nothing 
		if b then
			call EnableTrigger(T)
		else
			call DisableTrigger(T)
		endif
	endfunction
	
	private function init takes nothing returns nothing
		set T = CreateTrigger()
		call DisableTrigger(T)
		call TriggerRegisterTimerEvent(T,45.0,true)
		call TriggerAddAction(T,function ProximitySpawn)
	endfunction

endlibrary